# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo03
# Description:
# Author:       98745
# Date:         2019/3/3
#-------------------------------------------------------------------------------

class A:
    def __init__(self):
        print('A init')
class B(A):
    def __init__(self,h):
        super().__init__()
        self.h=h
    def e(self):
        if self.h:
            print('已经吃了虫子')
            self.h=False
        else:
            print('已经吃过饭了，不饿了')

b=B(False)
b.e()
b.e()

class SB(B):
    def __init__(self,h):
        super(SB,self).__init__(h)
        self.s='向天再借500年'
    def sing(self):
        print(self.s)

sb=SB(True)
sb.sing()
sb.e()